// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** addField POST /api/fields/add */
export async function addFieldUsingPost(body: API.FieldsAddDto, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean_>('/api/fields/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** deleteField DELETE /api/fields/delete */
export async function deleteFieldUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteFieldUsingDELETEParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/fields/delete', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** listField GET /api/fields/list */
export async function listFieldUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listFieldUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListFields_>('/api/fields/list', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** listFieldById GET /api/fields/list/id */
export async function listFieldByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listFieldByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseFields_>('/api/fields/list/id', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** updateField PUT /api/fields/update */
export async function updateFieldUsingPut(
  body: API.FieldsUpdateDto,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/fields/update', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
